package com.bdqn.demo01;

import com.bdqn.demo01.dao.NewsDao;
import com.bdqn.demo01.factory.AbstractFactory;
import com.bdqn.demo01.factory.OracleDaoFactory;
import com.bdqn.demo01.service.NewsServiceImpl;

/**
 * Test01
 *
 * @author LILIBO
 * @since 2022-09-24
 */
public class Test01 {

    public static void main(String[] args) {

        // 通过简单工厂生产出NewDao接口的实现类
        // NewsDao newsDao = NewsDaoFactory.getInstance("mysql");

        AbstractFactory factory = new OracleDaoFactory();
        NewsDao newsDao = factory.getInstance();
        NewsServiceImpl newsService = new NewsServiceImpl(newsDao);
        newsService.list();
    }
}
